package com.leyou.domain.db1entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class CouponrecordExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public CouponrecordExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        protected void addCriterionForJDBCTime(String condition, Date value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Time(value.getTime()), property);
        }

        protected void addCriterionForJDBCTime(String condition, List<Date> values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            List<java.sql.Time> timeList = new ArrayList<java.sql.Time>();
            Iterator<Date> iter = values.iterator();
            while (iter.hasNext()) {
                timeList.add(new java.sql.Time(iter.next().getTime()));
            }
            addCriterion(condition, timeList, property);
        }

        protected void addCriterionForJDBCTime(String condition, Date value1, Date value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Time(value1.getTime()), new java.sql.Time(value2.getTime()), property);
        }

        public Criteria andRecordkeyIsNull() {
            addCriterion("recordkey is null");
            return (Criteria) this;
        }

        public Criteria andRecordkeyIsNotNull() {
            addCriterion("recordkey is not null");
            return (Criteria) this;
        }

        public Criteria andRecordkeyEqualTo(String value) {
            addCriterion("recordkey =", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyNotEqualTo(String value) {
            addCriterion("recordkey <>", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyGreaterThan(String value) {
            addCriterion("recordkey >", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyGreaterThanOrEqualTo(String value) {
            addCriterion("recordkey >=", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyLessThan(String value) {
            addCriterion("recordkey <", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyLessThanOrEqualTo(String value) {
            addCriterion("recordkey <=", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyLike(String value) {
            addCriterion("recordkey like", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyNotLike(String value) {
            addCriterion("recordkey not like", value, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyIn(List<String> values) {
            addCriterion("recordkey in", values, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyNotIn(List<String> values) {
            addCriterion("recordkey not in", values, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyBetween(String value1, String value2) {
            addCriterion("recordkey between", value1, value2, "recordkey");
            return (Criteria) this;
        }

        public Criteria andRecordkeyNotBetween(String value1, String value2) {
            addCriterion("recordkey not between", value1, value2, "recordkey");
            return (Criteria) this;
        }

        public Criteria andReceivetimeIsNull() {
            addCriterion("receivetime is null");
            return (Criteria) this;
        }

        public Criteria andReceivetimeIsNotNull() {
            addCriterion("receivetime is not null");
            return (Criteria) this;
        }

        public Criteria andReceivetimeEqualTo(Date value) {
            addCriterionForJDBCTime("receivetime =", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeNotEqualTo(Date value) {
            addCriterionForJDBCTime("receivetime <>", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeGreaterThan(Date value) {
            addCriterionForJDBCTime("receivetime >", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCTime("receivetime >=", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeLessThan(Date value) {
            addCriterionForJDBCTime("receivetime <", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeLessThanOrEqualTo(Date value) {
            addCriterionForJDBCTime("receivetime <=", value, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeIn(List<Date> values) {
            addCriterionForJDBCTime("receivetime in", values, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeNotIn(List<Date> values) {
            addCriterionForJDBCTime("receivetime not in", values, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeBetween(Date value1, Date value2) {
            addCriterionForJDBCTime("receivetime between", value1, value2, "receivetime");
            return (Criteria) this;
        }

        public Criteria andReceivetimeNotBetween(Date value1, Date value2) {
            addCriterionForJDBCTime("receivetime not between", value1, value2, "receivetime");
            return (Criteria) this;
        }

        public Criteria andCouponkeyIsNull() {
            addCriterion("couponkey is null");
            return (Criteria) this;
        }

        public Criteria andCouponkeyIsNotNull() {
            addCriterion("couponkey is not null");
            return (Criteria) this;
        }

        public Criteria andCouponkeyEqualTo(String value) {
            addCriterion("couponkey =", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyNotEqualTo(String value) {
            addCriterion("couponkey <>", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyGreaterThan(String value) {
            addCriterion("couponkey >", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyGreaterThanOrEqualTo(String value) {
            addCriterion("couponkey >=", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyLessThan(String value) {
            addCriterion("couponkey <", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyLessThanOrEqualTo(String value) {
            addCriterion("couponkey <=", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyLike(String value) {
            addCriterion("couponkey like", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyNotLike(String value) {
            addCriterion("couponkey not like", value, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyIn(List<String> values) {
            addCriterion("couponkey in", values, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyNotIn(List<String> values) {
            addCriterion("couponkey not in", values, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyBetween(String value1, String value2) {
            addCriterion("couponkey between", value1, value2, "couponkey");
            return (Criteria) this;
        }

        public Criteria andCouponkeyNotBetween(String value1, String value2) {
            addCriterion("couponkey not between", value1, value2, "couponkey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyIsNull() {
            addCriterion("activitykey is null");
            return (Criteria) this;
        }

        public Criteria andActivitykeyIsNotNull() {
            addCriterion("activitykey is not null");
            return (Criteria) this;
        }

        public Criteria andActivitykeyEqualTo(String value) {
            addCriterion("activitykey =", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyNotEqualTo(String value) {
            addCriterion("activitykey <>", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyGreaterThan(String value) {
            addCriterion("activitykey >", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyGreaterThanOrEqualTo(String value) {
            addCriterion("activitykey >=", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyLessThan(String value) {
            addCriterion("activitykey <", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyLessThanOrEqualTo(String value) {
            addCriterion("activitykey <=", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyLike(String value) {
            addCriterion("activitykey like", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyNotLike(String value) {
            addCriterion("activitykey not like", value, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyIn(List<String> values) {
            addCriterion("activitykey in", values, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyNotIn(List<String> values) {
            addCriterion("activitykey not in", values, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyBetween(String value1, String value2) {
            addCriterion("activitykey between", value1, value2, "activitykey");
            return (Criteria) this;
        }

        public Criteria andActivitykeyNotBetween(String value1, String value2) {
            addCriterion("activitykey not between", value1, value2, "activitykey");
            return (Criteria) this;
        }

        public Criteria andPhoneIsNull() {
            addCriterion("phone is null");
            return (Criteria) this;
        }

        public Criteria andPhoneIsNotNull() {
            addCriterion("phone is not null");
            return (Criteria) this;
        }

        public Criteria andPhoneEqualTo(String value) {
            addCriterion("phone =", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotEqualTo(String value) {
            addCriterion("phone <>", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThan(String value) {
            addCriterion("phone >", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThanOrEqualTo(String value) {
            addCriterion("phone >=", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneLessThan(String value) {
            addCriterion("phone <", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneLessThanOrEqualTo(String value) {
            addCriterion("phone <=", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneLike(String value) {
            addCriterion("phone like", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotLike(String value) {
            addCriterion("phone not like", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneIn(List<String> values) {
            addCriterion("phone in", values, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotIn(List<String> values) {
            addCriterion("phone not in", values, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneBetween(String value1, String value2) {
            addCriterion("phone between", value1, value2, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotBetween(String value1, String value2) {
            addCriterion("phone not between", value1, value2, "phone");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}